/* 升级FF高版本后界面微调 */
#nav-bar {top: 1px !important;}
#tabbrowser-tabs {border-left-width: 0px !important;}
#tabbrowser-tab {padding-left: 0px !important; }
#back-button {padding-left:0px !important;  
              padding-right:0px !important; 
              margin-left: -5px !important; }
#forward-button{padding-right: 6px !important;
                padding-left: 0px !important;}
#titlebar {margin-top: 0px  !important;}
#toolbar-menubar{margin-bottom: -2px !important;}
#tab-stack{bottom: -1px !important;}

/* 界面规则 */
:root {
          --globle-height: 28px !important;
          /* 地址栏最小宽度 */
          --url-container-width: 120px !important;
          /* 地址栏最大宽度 */
          --url-container-max-width: 220px !important;
          --url-container-max-height: 28px !important;
          --urlbar-min-height: 28px !important;
          /* 标签页非选中宽度 */

          --tab-min-height: 25px !important;
          --tab-max-height: 25px !important;
        }
        
        :root[uidensity="compact"] {
          --tab-min-height: var(--globle-height) !important;
        }
        
        :root[uidensity="compact"] #urlbar {
          min-height: var(--globle-height) !important;
        }

        /* 隐藏元素 */
        /* 忘记是什么了 #alltabs-button,#unified-extensions-button, */ 
        #star-button-box {display: none !important;}
        #navigator-toolbox #titlebar #toolbar-menubar
        hbox.titlebar-spacer:nth-child(3),
        hbox.titlebar-spacer:nth-child(1),
        /* 标签页关闭按钮 */.tab-close-button,
        /* 新建标签页按钮 #tabs-newtab-button,*/
        /* 地址栏前进按钮 */ #navigator-toolbox #nav-bar #nav-bar-customization-target #back-button，
        /* 地址栏后退按钮 */#navigator-toolbox #nav-bar #nav-bar-customization-target #forward-button,
        /* 地址栏搜索图标 */#identity-box,
        /* 地址栏安全图标 */#tracking-protection-icon-container,
        /* 地址栏背景元素 */#urlbar-background {
          display: none !important;
        }
        
        /* 设置整个导航工具栏为弹性盒模型，反转地址栏和标签栏的位置 */
        #navigator-toolbox {
          /* position: relative !important; */
          display: flex !important;
          justify-content: start !important;
          flex-direction: row-reverse !important;
          flex-wrap: wrap !important;
        }
        
        #navigator-toolbox > #titlebar {
          -moz-appearance: unset !important;
          margin-left: 1px !important;
          flex: 1 !important;
          height: var(--globle-height) !important;
                  width: 110px !important;
        }
        #tabbrowser-tab{width: 110px !important;}
        /* flex设置为0后，max-width无效，因此不用设置max-width + !important，
            从而导致关闭标签后max-width因为!important属性而无法设置为空，进而导致标签无法关闭的bug */

        
        .tab-background {
          height: 25px !important;
          border-radius: 6px !important;
          margin: 0px !important;
          padding-top: 6px !important;
        }

        
        /* 地址栏,消除一些边距 */
        #nav-bar,
        #nav-bar-customization-target,
        #urlbar-container {
          margin: 0px !important;
          padding: 0px !important;
          height: var(--globle-height) !important;
        }
        
        #urlbar-container {
          min-width: var(--url-container-width) !important;
          max-width: var(--url-container-max-width) !important;
          height: var(--url-container-max-height) !important;
          max-height: var(--url-container-max-height) !important;
        }

        /* 地址栏宽度动画 
        #nav-bar > #nav-bar-customization-target > #urlbar-container {
          width: var(--url-container-width) !important;
          transition: width 400ms !important;
        }
        #nav-bar
          > #nav-bar-customization-target
          > #urlbar-container:hover:focus-within {
          width: var(--url-container-max-width) !important;
          transition: width 400ms !important;
        }
        
        #urlbar[breakout]:hover > vbox.urlbarView {
          display: block !important;
        }
        
        #urlbar > vbox.urlbarView {
          background-color: #37363ac9 !important;
          display: none !important;
        }
        
        /* 书签栏 */
        #PersonalToolbar {
          width: 28px !important;
          height: 28px !important;
          padding-inline: 0 !important;
          margin-right: 1px !important;
        }
        
        /* 书签列表中的元素长宽 */
        menuitem.bookmark-item {
          min-width: 20em !important;
          max-width: 20em !important;
        }
        
        /* 修改书签组图标 */
        #PlacesChevron {
          list-style-image: url("chrome://browser/skin/bookmark.svg") !important;
        }
        
    /*移动三道杠到最左边*/
    #PanelUI-button { 
order: -1;    border-left-width: 0px !important;
    border-left-style: solid !important;
    margin-left: 0px !important;
    padding-left: 0px !important;
    padding-top: 1px !important; 
    }
    #appMenu-popup {
    margin-left: 0px !important;        
    }